package P009;

import org.junit.Test;

/**
 * @Author DJ同学
 * @Date 2021/2/8 23:39
 * @Version 1.0
 * @Name 回文数
 * @Problem https://leetcode-cn.com/problems/palindrome-number/
 */
public class Solution {
    @Test
    public void test01(){
        System.out.println(isPalindrome(1231));
    }

    public boolean isPalindrome(int x) {
        String s = String.valueOf(x);
        boolean f=true;
        for(int i=0;i<s.length()/2;i++)
        {
            if(s.charAt(i)!=s.charAt(s.length()-1-i)){
                f=false;
                break;
            }
        }
        return f;
    }
}
